import { Routes, Route,Navigate } from "react-router-dom";
import Home from '../views/home/home'
import Login from '../views/login/login'
import Register from '../views/register/register'
import Type from '../views/type/type'
import Detail from "../views/detail/detail";

export default function MyRouter() {
  return (
    <Routes>
        <Route path="/home" element={<Home />} />
        <Route path="/login" element={<Login />} />
        <Route path="/register" element={<Register />} />
        <Route path="/type" element={<Type />} />
        <Route path="/detail" element={<Detail />} />

        {/* router6的路由重定向写法 */}
        <Route path="/home" element={<Navigate to="/home" replace />} />
    </Routes>
  );
}
